from django.db import models
from datetime import datetime


# Create your models here.


class UiFiles(models.Model):
    case_name = models.CharField(max_length=100, verbose_name="用例名称", null=True)
    case_path = models.CharField(max_length=255, verbose_name="文件地址")
    create_time = models.DateTimeField(default=datetime.now(), verbose_name="创建时间")
    execute_time = models.DateTimeField(null=True, verbose_name="运行时间")
    functional = models.CharField(max_length=255, verbose_name="所属模块", default="2")
    status = models.CharField(max_length=10, verbose_name="0=未执行，1=已执行", default="0")


class UiReport(models.Model):
    report_path = models.CharField(max_length=255, verbose_name="报告地址")
    case = models.ForeignKey(UiFiles, on_delete=models.CASCADE, verbose_name="关联的case报告")
    generate_time = models.DateTimeField(default=datetime.now(), verbose_name="报告生成时间")
